package com.zhong.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author zbg on 2019-02-13 12:36:21
 */
@RestController
public class UserController {

    @PostMapping("/d1")
    public String d1(@RequestParam String id) {
        try {
            Thread.sleep(10*1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.err.println("provider1接收请求----------------" + new Date());
        return "请求参数：" + id;
    }

    @PostMapping("/d2")
    public String d2(@RequestParam String id)  {
        try {
            Thread.sleep(5*1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.err.println("provider1接收请求----------------" + new Date());
        return "请求参数：" + id;
    }
}
